home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
bioinformatics.org
/
bioinformatics.org_software.tar
/
www.bioinformatics.org
/
download
/
ecell2
/
ecell220setup.exe
/
{app}
/
standard
/
STDR
/
MassActionReactor.rd
< prev
next >
Wrap
Text File
|
2000-03-03
|
2KB
|
66 lines
@CLASSNAME: MassActionReactor
@BASECLASS: FluxReactor
@AUTHOR: Kouichi Takahashi
@EMAIL: shafi@sfc.keio.ac.jp
@DATE: 29/6/1999
%VERSION: ecs-v09, 0.1
@BRIEF_DESCRIPTION:General Mass Action
@DESCRIPTION:
A reactor class in which general mass action equation is embeded.
Velocity is\\ calculated as a product of concentrations of substrates
and a kinetic constant (see\\ Equation).
General mass action law is generally applicable to simple kinetic \\ processes
such as elementary reaction and other processes in which velocity
is\\ directly propotional to their substrates.
@EQUATION:$$v=k \prod_{i=0}^n [S_i]^{c_i}$$
%SUBSTANCE:Substrate, inf, 1
%SUBSTANCE:Product, inf, 1
%SUBSTANCE:Catalyst, 0, 0
%SUBSTANCE:Effector, 0, 0
%PARAMETER: k, Float, , Velocity Constant
%INCLUDE_FILE_C: stdio.h
@INITIALIZE_FUNC:
for(int i = 0 ; i<numSubstrate() ; i++){
if(!substrate(i)->substance().haveConcentration())
{
char buf[50];
sprintf(buf,"Cannot calculate concentration of substrate [%s].",
substrate(i)->substance().entryname().c_str());
warning(buf),condition(InitFail);
}
}
@REACT_FUNC:
// k * [S] = v : mol/L * s^-1 <- velocity in concentration!? (-_-;
// v * volume * N_A : numMol * s^-1 <- this is it! \(^^)
// (where N_A is Avogadro number)
// first calculate N_A * system volume * k for precision
Float velocity = k*N_A;
velocity *= _substrateList[0]->substance().supersystem()->volume();
int i = numSubstrate();
do{
--i;
// calculate velocity
int j = substrate(i)->coefficient();
do{
j--;
velocity *= substrate(i)->concentration();
} while(j != 0);
} while(i != 0);
// now we have change in number of molecules per second
process(velocity);